<script setup lang="ts">
import { ref } from "vue";
import DiaryUnitView from "./DiaryUnitView.vue"
import { DiaryUnitVData } from "@/vdata/DiaryUnitVData";

let props = defineProps({diaryUnits:Array<DiaryUnitVData>})
// let arr: DiaryUnitVData[] = [];
// let ref_arr = ref(arr);
function addDiaryUnit() {
    let vdata = new DiaryUnitVData(3);
    props.diaryUnits!.push(vdata);
}

</script>

<template>
    <div id="content">
        <div v-for="item in $props.diaryUnits!">
            <DiaryUnitView :diary-unit="item"></DiaryUnitView>
        </div>
        <el-button @click="addDiaryUnit">AddDiaryUnit</el-button>
    </div>
</template>

<style scoped>
#content {
    background-color: red;
}
</style>